﻿@inject IDataService DataService
@{
    PostModel postModel = (PostModel)Model;
    string cover = $"{Url.Content("~/")}{postModel.Post.Cover}";
    ViewData["BlogTitle"] = postModel.Blog.Title;
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link href="~/themes/cleanblog/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="~/themes/cleanblog/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
    <link href="~/themes/cleanblog/css/clean-blog.css" rel="stylesheet">
    <partial name="~/Views/Shared/HeaderScript.cshtml" />
</head>

<body>
    <!-- Navigation -->
    <nav class="navbar navbar-expand-lg navbar-light fixed-top" id="mainNav">
        <div class="container">
            <a class="navbar-brand" href="~/">Home</a>
            <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
                Menu
                <i class="fas fa-bars"></i>
            </button>
            <div class="collapse navbar-collapse" id="navbarResponsive">
                <ul class="navbar-nav ml-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="~/blog">Blog</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="~/admin">Admin</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <!-- Page Header -->
    <header class="masthead" style="background-image: url('@cover')">
        <div class="overlay"></div>
        <div class="container">
            <div class="row">
                <div class="col-lg-8 col-md-10 mx-auto">
                    <div class="post-heading">
                        <h1>@postModel.Post.Title</h1>
                        <h2 class="subheading">@Html.Raw(postModel.Post.Description)</h2>
                        <span class="meta mb-1">
                            Posted by @postModel.Post.Author.DisplayName on @postModel.Post.Published.ToFriendlyDateString()
                        </span>
                        @if (!string.IsNullOrEmpty(postModel.Post.Categories))
                        {
                            <span class="tags">
                                Tags: @Html.Raw(string.Join(", ", postModel.Post.Categories.Split(",").Select(s => string.Format("<a href=\"{0}{1}\" class=\"post-cata cata-sm cata-danger\">{1}</a>", Url.Content("~/categories/"), s))))
                            </span>
                        }
                    </div>
                </div>
            </div>
        </div>
    </header>

    <!-- Post Content -->
    <article>
        <div class="container">
            <div class="row">
                <div class="col-lg-8 col-md-10 mx-auto post-content">

                    @Html.Raw(postModel.Post.Content)

                    <div id="disqus_thread"></div>
                </div>
            </div>
        </div>
    </article>

    <hr>

    <!-- Footer -->
    <partial name="~/Views/Themes/CleanBlog/Shared/Footer.cshtml" model="postModel.Post.SocialFields" view-data="ViewData" />

    <script src="~/themes/cleanblog/vendor/jquery/jquery.min.js"></script>
    <script src="~/themes/cleanblog/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="~/themes/cleanblog/js/clean-blog.min.js"></script>

    <partial name="~/Views/Shared/FooterScript.cshtml" />
</body>
</html>
